package cn.cxg.ymcc.web.controller;


import cn.cxg.ymcc.result.JSONResult;
import cn.cxg.ymcc.service.VerfycodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.websocket.server.PathParam;

@RestController
@RequestMapping("verifycode")
public class VerfycodeController {

    @Autowired
    private VerfycodeService verfycodeService;

    /**
     * 短信验证码码
     * @param phone
     * @return
     */
    @GetMapping("/sendSmsCode/{phone}")
    public JSONResult sendSmsCode(@PathVariable("phone") String phone){

        verfycodeService.sendCode(phone);

        return JSONResult.success();
    }
}
